package com.cn.study008;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName Test8001.java
 * @Description
 * @createTime 2023年05月14日 18:03:00
 */
public class Test8001 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] a=new int[]{8,4,2,1,23,344,12};
        int sum=0;
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i]+" ");
            sum+=a[i];
        }
        System.out.println("\n数列和为"+sum);
        System.out.println("猜数游戏，请输入一个数：");
        int n=sc.nextInt();
        for (int i = 0; i < a.length; i++) {
            if (n==a[i]){
                System.out.println("该数列中包含此数。");
            }
        }
    }
}
